#include "Month.h"

class Year
{
private:
	int Number;
	Month Months[12];
	
	void setMonthes()
	{
		Months[0] = Month(31,"Jan");
		Months[1] = Month(isLeapYear() ? 29 : 28,"Feb"); //checks if it is leap year, if yes feb =29 else 28
		Months[2] = Month(31,"Mar");	
		Months[3] = Month(30,"Apr");
		Months[4] = Month(31,"May");
		Months[5] = Month(30,"Jun");
		Months[6] = Month(31,"Jul");
		Months[7] = Month(31,"Aug");
		Months[8] = Month(30,"Sep");
		Months[9] = Month(31,"Oct");
		Months[10] = Month(30,"Nov");
		Months[11] = Month(31,"Dec");
	}

public:
	Year(){}

	Year(int Number)
	{
		//Require(Number > 0 && Number > 1990)
		this->Number=Number;
		setMonthes();
		//Ensure (this->Number == Number)
	}

	void setYear(int Number)
	{
		//Require(Number > 0 && Number > 1990)
		this->Number=Number;
		//Ensure (this->Number == Number)
	}

	int getYear()
	{
		return Number;
	}

	Month* getMonths()
	{
		return Months;
	}

	bool isLeapYear()
	{
		bool isLeap;
		if (((Number % 4 == 0) && (Number % 100 != 0)) || ((Number % 100 == 0) && (Number % 400 ==0))) 
			return true;
		else 
			return false;
	}        

	~Year(){}

}